/*
Copyright [2023] [fuwen_soft]
*/
package vip.xiaonuo.modular.xylogyauth.controller;

import vip.xiaonuo.core.annotion.BusinessLog;
import vip.xiaonuo.core.annotion.Permission;
import vip.xiaonuo.core.enums.LogAnnotionOpTypeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import vip.xiaonuo.core.pojo.page.PageResult;
import vip.xiaonuo.modular.xylogyauth.param.XyLogyAuthParam;
import vip.xiaonuo.modular.xylogyauth.service.XyLogyAuthService;
import vip.xiaonuo.modular.xylogyauth.entity.XyLogyAuth;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.validation.annotation.Validated;
import vip.xiaonuo.core.annotion.version.AdminVersionSwagger;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import javax.annotation.Resource;
import java.util.List;
import vip.xiaonuo.sys.core.msg.Result;
import static vip.xiaonuo.sys.core.msg.ResultUtils.success;
/**
 * 用户与族谱得权限表控制器
 *
 * @author yanwei
 * @date 2023-05-05 15:44:27
 */
@RestController
@Api(tags = "后台管理 用户与族谱得权限表 相关APIS")
@AdminVersionSwagger
public class XyLogyAuthController {

    @Resource
    private XyLogyAuthService xyLogyAuthService;

    /**
     * 查询用户与族谱得权限表
     *
     * @author yanwei
     * @date 2023-05-05 15:44:27
     */
    @Permission
    @GetMapping("/xyLogyAuth/page")
    @BusinessLog(title = "用户与族谱得权限表_查询", opType = LogAnnotionOpTypeEnum.QUERY)
    @ApiOperation("用户与族谱得权限表_查询")
    public Result<PageResult<XyLogyAuth>> page(XyLogyAuthParam xyLogyAuthParam) {
        PageResult<XyLogyAuth> page = xyLogyAuthService.page(xyLogyAuthParam);
        return success(page);
    }

    /**
     * 添加用户与族谱得权限表
     *
     * @author yanwei
     * @date 2023-05-05 15:44:27
     */
    @Permission
    @PostMapping("/xyLogyAuth/add")
    @BusinessLog(title = "用户与族谱得权限表_增加", opType = LogAnnotionOpTypeEnum.ADD)
    @ApiOperation("用户与族谱得权限表_增加")
    public Result add(@RequestBody @Validated(XyLogyAuthParam.add.class) XyLogyAuthParam xyLogyAuthParam) {
            xyLogyAuthService.add(xyLogyAuthParam);
        return success();
    }

    /**
     * 删除用户与族谱得权限表，可批量删除
     *
     * @author yanwei
     * @date 2023-05-05 15:44:27
     */
    @Permission
    @PostMapping("/xyLogyAuth/delete")
    @BusinessLog(title = "用户与族谱得权限表_删除", opType = LogAnnotionOpTypeEnum.DELETE)
    @ApiOperation("用户与族谱得权限表_删除")
    public Result delete(@RequestBody @Validated(XyLogyAuthParam.delete.class) List<XyLogyAuthParam> xyLogyAuthParamList) {
            xyLogyAuthService.delete(xyLogyAuthParamList);
        return success();
    }

    /**
     * 编辑用户与族谱得权限表
     *
     * @author yanwei
     * @date 2023-05-05 15:44:27
     */
    @Permission
    @PostMapping("/xyLogyAuth/edit")
    @BusinessLog(title = "用户与族谱得权限表_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
    @ApiOperation("用户与族谱得权限表_编辑")
    public Result edit(@RequestBody @Validated(XyLogyAuthParam.edit.class) XyLogyAuthParam xyLogyAuthParam) {
            xyLogyAuthService.edit(xyLogyAuthParam);
        return success();
    }

    /**
     * 查看用户与族谱得权限表
     *
     * @author yanwei
     * @date 2023-05-05 15:44:27
     */
    @Permission
    @GetMapping("/xyLogyAuth/detail")
    @BusinessLog(title = "用户与族谱得权限表_查看", opType = LogAnnotionOpTypeEnum.DETAIL)
    @ApiOperation("用户与族谱得权限表_查看")
    public Result<XyLogyAuth> detail(@Validated(XyLogyAuthParam.detail.class) XyLogyAuthParam xyLogyAuthParam) {
        XyLogyAuth detail =   xyLogyAuthService.detail(xyLogyAuthParam);
        return success(detail);
    }

    /**
     * 用户与族谱得权限表列表
     *
     * @author yanwei
     * @date 2023-05-05 15:44:27
     */
    @Permission
    @GetMapping("/xyLogyAuth/list")
    @BusinessLog(title = "用户与族谱得权限表_列表", opType = LogAnnotionOpTypeEnum.QUERY)
    @ApiOperation("用户与族谱得权限表_列表")
    public Result<List<XyLogyAuth>> list(XyLogyAuthParam xyLogyAuthParam) {
        List<XyLogyAuth> list  =   xyLogyAuthService.list(xyLogyAuthParam);
        return success(list);
    }

    /**
     * 导出系统用户
     *
     * @author yanwei
     * @date 2023-05-05 15:44:27
     */
    @Permission
    @GetMapping("/xyLogyAuth/export")
    @BusinessLog(title = "用户与族谱得权限表_导出", opType = LogAnnotionOpTypeEnum.EXPORT)
    @ApiOperation("用户与族谱得权限表_导出")
    public void export(XyLogyAuthParam xyLogyAuthParam) {
        xyLogyAuthService.export(xyLogyAuthParam);
    }

}
